package gui.utils;

import java.awt.*;
import javax.swing.*;

/*Author: John Archer, Contact: john.archer.jpa@gmail.com*/
public class InputText extends JPanel{
    private JTextField txt;
    public InputText(String title, int len){
        super(new FlowLayout());
        this.setBorder(BorderFactory.createEmptyBorder(0,-4,0,-5));
        JLabel lab = new JLabel(title);
        lab.setFont(Borders.getFont(Borders.GUIFONT));
        lab.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
        this.add(lab, BorderLayout.WEST);
        txt = new JTextField(len);
        txt.setBorder(BorderFactory.createEmptyBorder(3,3,3,3));
        txt.setFont(Borders.getFont(Borders.GUIFONT));
        this.add(txt, BorderLayout.EAST);
    }

    public String getText(){return txt.getText();}
}